#include <stdio.h>
#define longlong _int64
//#define I64d lld
longlong H(int n){
    longlong res = 0;
    int t,i;
    for(i = 1 ,t = 0 ; t < n; i++ ){
			res+=i*(n/i-n/(i+1));
			res+=n/i;
			t+=(n/i-n/(i+1))+1;
			if(t==n-1){
				 res+=i+1;
				 break;
			}
    }
    return (res);
}
main(){
	int n,a,i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
	scanf("%d",&a);
	printf("%I64d\n",H(a));
	}
}